import json
import time

from Page import Page   #导入Page类
from Page1 import Page1
from  Page2 import Page2
from selenium import webdriver  #web端
import pytest

#读取json数据驱动
def du(path):
    with open(path,'r',encoding="utf8")as f:
        data = json.load(f)
        return data

@pytest.fixture(scope='function',autouse=True)
def driver():
    driver = webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.quit()

# @pytest.mark.parametrize('data',du(r'E:\gaoer\rk\pythonProject\Day_2304_Test\Unit_YKmn\163.json'))
# #调用登录业务
# def test_01_login(driver,data):
#     po = Page(driver)
#     po.luoji_163(data['yhm'],data['mm'])

#调用登录业务
def test_01_login(driver):
    po = Page(driver)
    po.luoji_163()


#调用写信的方法（调用登录）
# def test_02_rightxin(driver):
#     #调用完登录
#     po = Page(driver)
#     po.luoji_163()
#     #调用写信的业务
#     po = Page1(driver)
#     # po.frame()
#     time.sleep(2)
#     po.xiexin()
#     time.sleep(2)
#     # print(po.dy1())
#     po.dy1()
#     time.sleep(2)
#     po.shoujianren()
#     time.sleep(2)
#     po.zhuti()
#     time.sleep(2)
#     po.neirong()
#     time.sleep(5)
#     po.fasong()
#     # time.sleep(5)
#     driver.implicitly_wait(5)
#     # po.dy2()
#     # time.sleep(8)

#调用收信的方法（调用登录）
# def test_03_shouxin(driver):
#     # 调用完登录
#     po = Page(driver)
#     po.luoji_163()
#     #调用收信的业务
#     po = Page2(driver)
#     po.shouxin()
#     time.sleep(2)
#     # po.weidu()
#     # time.sleep(2)








